package org.example.demo3_yilai.before;

import org.example.demo3_yilai.after.Car;

/**
 * 汽车系统
 * @author lemon
 */
public class AutoSystem {
    private FordCar fordCar;
    private HandaCar handaCar;
    public HandaCar getHandaCar() {
        return handaCar;
    }

    public FordCar getFordCar() {
        return fordCar;
    }

    public void setFordCar(FordCar fordCar) {
        this.fordCar = fordCar;
    }

    public void setHandaCar(HandaCar handaCar) {
        this.handaCar = handaCar;
    }
    public void runCar(){
        handaCar.run();
        fordCar.runCar();
    }
    public void stopCar(){
        handaCar.stop();
        fordCar.stopCar();
    }
    public void turnCar(){
        handaCar.turn();
        fordCar.turnCar();
    }
}
